require(['init'], function () {
//  var comments=UE.getEditor('comments');
  var replyid  = location.search.urlToObj().replyid;
  var studentuid=location.search.urlToObj().studentuid;
  var taskid=location.search.urlToObj().taskid;
  var studentname=location.search.urlToObj().studentname;
  var classe=location.search.urlToObj().classe;
    var type = location.search.urlToObj().type
    var classeid = location.search.urlToObj().classeid;
    $('.navname').attr('href','./teacher_class_lesson.html?type='+type+'&classeid='+classeid+'')
   //获取老师布置作业和上课的返回信息
  $.ajax({
       url:'/api/task/subject/'+taskid,
       type:'get',
       success:function(data){
         var data=data.data;
         var classeid=data.classeid;
         var scheduleid=data.scheduleid;
          $('.oldcontent').html(data.content);
          $('.title').html(data.title);
          $('.oldnote').html(data.note);
          $('#wrap').find('a').attr('target','_blank');
        if(data.classetype==2){
           $.ajax({
             url:'/api/classe/'+classeid,
             type:'get',
             success:function(json){
               console.log(json)
               $('.classname').html(json.data.classname)
             }
           })

         }else if(data.classetype==1){
           var aboutclass=i18next.t('table.aboutclass');
           $('.classname').html(aboutclass);
         }
         $.ajax({
           url:'/api/schedule/'+scheduleid,
           type:'get',
           success:function(datat){
            $.each(datat,function(int,ite){
            $('.lessonname').html(ite.name)
            })
           }
        })
     }
  })
  //获取学生的答案
  $('.wrap').find('a').attr('target','_blank');


})
